#include <stdio.h>
#include <stdlib.h>
#include "my_node.h"
int main(int argc, char *argv[])
{
    // 1. open file
    // my_prog XXX.cpp
    FILE *fp = fopen(argv[1],"r");
    int filesize;
    char *buffer;
    if(fp == NULL)
        return 0;
    // 2. read file to buffer
    fseek(fp,0L,SEEK_END);
    filesize = ftell(fp);
    fseek(fp,0L,SEEK_SET);

    if(filesize>0)
    {
        buffer = (char *)malloc(filesize+1);
        buffer[filesize]='\0';
    }

    fread(buffer,filesize,1,fp);

    if(fp)
        fclose(fp);

    scanbuffer(buffer,filesize);

    if(buffer)
        free(buffer);
    return 0;
}
